<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>编辑客户端表单</title>
		<link rel="stylesheet" type="text/css"
			href="<%=basePath%>skins/themes/default/easyui.css">
		<link rel="stylesheet" type="text/css"
			href="<%=basePath%>skins/themes/icon.css">
		<link rel="stylesheet" type="text/css"
			href="<%=basePath%>skins/themes/demo.css">
		<script type="text/javascript"
			src="<%=basePath%>skins/jquery-1.7.2.min.js">
</script>
		<script type="text/javascript"
			src="<%=basePath%>skins/jquery.easyui.min.js">
</script>
		<script type="text/javascript">
function submit() {
	$('#inningsForm').form('submit', {
		url : '<%=basePath%>innings/update.action',
		onSubmit : function() {
			var flag = $(this).form('validate');
			if (flag) {
				showProcess(true, '温馨提示', '正在提交数据...');
			}
			return flag;
		},
		success : function(result) {
			showProcess(false);
			var result = eval('(' + result + ')');
			if (result.success === true) {
				$.messager.alert('温馨提示', result.message);
				resize();
				parent.$('#data').datagrid('reload');
			} else {
				$.messager.alert('温馨提示', result.message);
			}
		},
		onLoadError : function() {
			showProcess(false);
			$.messager.alert('温馨提示', '由于网络或服务器太忙，提交失败，请重试！');
		}
	});
}
function resize() {
	$('#inningsForm').form('clear');
	parent.$('#inningsWindow').window('close');
}
function showProcess(isShow, title, msg) {
	if (!isShow) {
		$.messager.progress('close');
		return;
	}
	var win = $.messager.progress( {
		title : title,
		msg : msg
	});
}
</script>
	</head>
	<body>
		<div class="easyui-layout" fit="true">
			<div region="center" border="false"
				style="padding: 10px; background: #fff; border: 1px solid #ccc;">
				<form id="inningsForm" method="post">
					<div>
						<input type="hidden" id="id" name="innings.inningSn"
							value="<s:property value="innings.inningSn" />">
					</div>
					<div>
						操&nbsp;&nbsp;作&nbsp;&nbsp;员：
						<input type="text" id="member" name="innings.memberName"
							style="width: 200px" class="easyui-validatebox" required="true"
							value="<s:property value="innings.memberName" />" />
					</div>
					<div>
						投保金额：
						<input type="text" id="insure" name="innings.insure"
							style="width: 200px" class="easyui-validatebox" required="true"
							value="<s:property value="innings.insure" />" />
					</div>
					<div>
						赔&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;率：
						<input type="text" id="odds" name="innings.odds"
							class="easyui-validatebox" required="true" style="width: 200px"
							value="<s:property value="innings.odds" />" />
					</div>
				</form>
			</div>
			<div region="south" border="false"
				style="text-align: right; padding: 5px 0;">
				<a class="easyui-linkbutton" iconCls="icon-ok"
					href="javascript:void(0)" onclick="submit()">提交</a>
				<a class="easyui-linkbutton" iconCls="icon-cancel"
					href="javascript:void(0)" onclick="resize()">取消</a>
			</div>
		</div>
	</body>
</html>
